package com.example.takeaway.model.bo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author 邢晨旭
 * @since 2023-10-12
 */
@Getter
@Setter
@TableName("`order`")
public class Order extends BaseBO {

    /**
     * 订单ID（主键）
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单号
     */
    @TableField("order_number")
    private Long orderNumber;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 店铺ID
     */
    @TableField("shop_id")
    private Long shopId;

    /**
     * 订单状态(0:创建, 1:待接单, 2:备餐中, 3:配送中,4:已完成, 5:已取消)
     */
    @TableField("status")
    private Integer status;

    /**
     * 下单时间
     */
    @TableField("order_time")
    private LocalDateTime orderTime;

    /**
     * 付款时间
     */
    @TableField("payment_time")
    private LocalDateTime paymentTime;

    /**
     * 支付方式
     */
    @TableField("payment_method")
    private String paymentMethod;

    /**
     * 支付状态(-1:支付失败,0:待支付, 1:已支付, 2:已退款)
     */
    @TableField("payment_status")
    private Integer paymentStatus;

    /**
     * 实收金额
     */
    @TableField("total_amount")
    private BigDecimal totalAmount;

    /**
     * 备注
     */
    @TableField("notes")
    private String notes;

    /**
     * 订单取消原因
     */
    @TableField("cancel_reason")
    private String cancelReason;

    /**
     * 订单取消时间
     */
    @TableField("cancel_time")
    private LocalDateTime cancelTime;

    /**
     * 预计送达时间
     */
    @TableField("estimated_delivery_time")
    private LocalDateTime estimatedDeliveryTime;

    /**
     * 送达时间
     */
    @TableField("actual_delivery_time")
    private LocalDateTime actualDeliveryTime;

    /**
     * 打包费
     */
    @TableField("packaging_fee")
    private BigDecimal packagingFee;

    /**
     * 餐具数量
     */
    @TableField("utensil_quantity")
    private Integer utensilQuantity;

    /**
     * 餐具数量状态(0:未提供, 1:已提供)
     */
    @TableField("utensil_status")
    private Integer utensilStatus;
}
